package org

import "context"

type OrgRepositoryIface interface {
	// Save 保存/更新组织数据
	Save(ctx context.Context, org *GfyOrganizationPo, subOrgList []*GfyOrganizationPo, orgAreaCodes []string) (int64, error)
	// Delete 删除组织
	Delete(ctx context.Context, orgId int64, buGuid string) error
	// List 组织列表
	List(ctx context.Context) ([]*GfyOrganizationPo, error)
	// ListByOrgIds 根据编号获取组织列表
	ListByOrgIds(ctx context.Context, orgIds []int64) ([]*GfyOrganizationPo, error)
	// BatchAdd 批量增加组织
	BatchAdd(ctx context.Context, orgs []*GfyOrganizationPo) error
	// GetById 获取单条数据
	GetById(ctx context.Context, orgId int64) (*GfyOrganizationPo, error)
	// GetByUid 获取单条数据
	GetByUid(ctx context.Context, orgUid string) (*GfyOrganizationPo, error)
	// CheckFullName 检查名称是否
	CheckFullName(ctx context.Context, orgId int64, fullName string) (*GfyOrganizationPo, error)
	// CheckFullNameV2 检查名称是否
	CheckFullNameV2(ctx context.Context, fullName string) (*GfyOrganizationPo, error)
	// OrgListByParentId 根据parentid查子部门
	OrgListByParentId(ctx context.Context, parentId int64) ([]*GfyOrganizationPo, error)
	// OrgAllList 查下所有的部门
	OrgAllList(ctx context.Context) ([]*GfyOrganizationPo, error)
	// GetAllSubOrg 获取子部门
	GetAllSubOrg(ctx context.Context, orgId int64) ([]int64, error)
	// CheckRootOrg 检查根组织是否存在
	CheckRootOrg(ctx context.Context) (bool, error)
	// OrgAreaList 获取组织区域列表
	OrgAreaList(ctx context.Context) ([]*GfyxOrganizationAreaPermissionPo, error)
	// OrgAreaListByOrgIds 根据组织id 获取权限
	OrgAreaListByOrgIds(ctx context.Context, orgIds []int64) ([]*GfyxOrganizationAreaPermissionPo, error)
	// GetOrgListByUserId 获取用户所在的部门
	GetOrgListByUserId(ctx context.Context, userId int64) ([]*OrganizationCollection, error)
	// SaveOrgAreasNew 临时保存
	SaveOrgAreasNew(ctx context.Context, orgId int64, createdBy string, areaCodes []string) error
}
